home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Demos / OOFILE / Buildable, limited OOFILE / c-tree headers / ctport.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-24  |  18.3 KB  |  677 lines  |  [TEXT/CWIE]

  1. /*
  2.  *    This program is the CONFIDENTIAL and PROPRIETARY property 
  3.  *    of FairCom(R) Corporation. Any unauthorized use, reproduction or
  4.  *    transfer of this computer program is strictly prohibited.
  5.  *
  6.  *      Copyright (c) 1984 - 1994 FairCom Corporation.
  7.  *    This is an unpublished work, and is subject to limited distribution and
  8.  *    restricted disclosure only. ALL RIGHTS RESERVED.
  9.  *
  10.  *            RESTRICTED RIGHTS LEGEND
  11.  *    Use, duplication, or disclosure by the Government is subject to
  12.  *    restrictions set forth in subparagraph (c)(1)(ii) of the Rights in
  13.  *     Technical Data and Computer Software clause at DFARS 252.227-7013.
  14.  *    FairCom Corporation, 4006 West Broadway, Columbia, MO 65203.
  15.  *
  16.  *    c-tree PLUS(tm)    Version 6.4
  17.  *            Release B
  18.  *            October 19, 1994
  19.  */
  20.  
  21. #ifndef ctPORTH
  22. #define ctPORTH
  23. #include "ctlfun.h"
  24.  
  25. #define PERFORM_OFF    0
  26. #define PERFORM_ON    1
  27. #define PERFORM_DUMP    2
  28.  
  29. #ifndef FAST
  30. #define    FAST    register                /* register variable       */
  31. #endif
  32. #ifndef PFAST
  33. #define PFAST    register            /* register parameter       */
  34. #endif
  35. #define    EXTERN    extern                /* External variable       */
  36. #define    GLOBAL    /* */                /* Global variable       */
  37. #define    LOCAL    static                /* Local to module       */
  38.  
  39. #ifdef ctBAN5 /* Banyan 5.5 toolkit */
  40. #undef VOID 
  41. #endif
  42.  
  43. #define VOID    void
  44.  
  45. #ifndef ctEXPORT
  46. #define ctEXPORT
  47. #endif
  48.  
  49. typedef VOID ctMEM *    pVOID;
  50. typedef VOID ctMEM * ctMEM *    ppVOID;
  51. typedef short int    COUNT;
  52. typedef COUNT ctMEM *    pCOUNT;
  53. typedef COUNT ctMEM * ctMEM *    ppCOUNT;
  54. typedef unsigned short int    UCOUNT; /* some 16 bit compilers might  */
  55. typedef UCOUNT ctMEM *    pUCOUNT;
  56.                 /* require unsigned int instead */
  57. #ifndef SYS_NINT
  58. typedef int        NINT;    /* natural integer */
  59. #endif
  60. #ifndef SYS_UINT
  61. typedef unsigned int    UINT;
  62. #endif
  63.  
  64. typedef NINT ctMEM *    pNINT;
  65. typedef UINT ctMEM *    pUINT;
  66.  
  67. typedef long int    NLONG;
  68. typedef unsigned long    UNLONG;
  69.  
  70. #ifndef SYS_LONG
  71. #ifndef LONG
  72. typedef long int    LONG;
  73. #endif
  74. #endif
  75. typedef LONG ctMEM *    pLONG;
  76.  
  77. #ifndef SYS_ULONG
  78. #ifndef ULONG
  79. typedef unsigned long    ULONG;
  80. #endif
  81. #endif
  82. typedef ULONG ctMEM *    pULONG;
  83.  
  84. typedef LONG        VRLEN;
  85. typedef VRLEN ctMEM *    pVRLEN;
  86.  
  87. typedef LONG        IOSIZE;
  88. typedef IOSIZE ctMEM *    pIOSIZE;
  89. typedef char        TEXT;
  90. typedef TEXT ctMEM *    pTEXT;
  91. typedef TEXT ctMEM * ctMEM * ppTEXT;
  92.  
  93. #ifndef __PROGRAM_COUNTER_TYPE__
  94. #define __PROGRAM_COUNTER_TYPE__ UINT
  95. #endif
  96.  
  97. typedef __PROGRAM_COUNTER_TYPE__ PROGRAM_COUNTER;
  98.  
  99. #ifndef __ERROR_CHECK_ONLY__
  100.  
  101. #ifndef ctProcPtr
  102. #define ctProcPtr
  103. #if !defined(THINK_C) && !defined(__MWERKS__) 
  104. typedef NINT (*ProcPtr)();
  105. #endif
  106. #endif
  107.  
  108. #else  /*  __ERROR_CHECK_ONLY__  */
  109.  
  110. typedef NINT (*ProcPtr)(VOID);
  111.  
  112. #endif  /*  __ERROR_CHECK_ONLY__  */
  113.  
  114. #ifndef ctDllDecl
  115. #define ctDllDecl
  116. #endif
  117.  
  118. #ifndef __ERROR_CHECK_ONLY__
  119.  
  120. typedef NINT (ctDllDecl *FarCmdPtr)();
  121.  
  122. #else  /*  ~__ERROR_CHECK_ONLY__  */
  123.  
  124. typedef NINT (ctDllDecl *FarCmdPtr)(VOID);
  125.  
  126. #endif  /*  ~__ERROR_CHECK_ONLY__  */
  127.  
  128. #ifdef ctSP
  129. typedef FarCmdPtr   far * pFarCmdPtr;
  130. #else
  131. typedef FarCmdPtr ctMEM * pFarCmdPtr;
  132. #endif
  133.  
  134. #ifndef __ERROR_CHECK_ONLY__
  135.  
  136. typedef FarCmdPtr * (ctDllDecl *FarCmdBase)();
  137.  
  138. #else
  139.  
  140. typedef FarCmdPtr * (ctDllDecl *FarCmdBase)(VOID);
  141.  
  142. #endif
  143.  
  144. typedef FILE *        pFILE;
  145. #ifdef CT_ANSI
  146. typedef pFILE        RNDFILE;
  147. #else
  148. #ifndef ctRNDFILE
  149. typedef int        RNDFILE;
  150. #endif
  151. typedef RNDFILE ctMEM *    pRNDFILE;
  152. #endif
  153.  
  154. typedef unsigned char    UTEXT;    /* if unsigned char not supported, make char */
  155. typedef UTEXT ctMEM *    pUTEXT;
  156. typedef UTEXT ctMEM * ctMEM * ppUTEXT;
  157. typedef LONG        POINTER,DATET; 
  158. typedef POINTER ctMEM *    pPOINTER;
  159. typedef char           *TEXTPTR;
  160. #define ctRECPT        LONG
  161. #define pctRECPT    pLONG
  162.  
  163. #ifdef YES
  164. #undef YES
  165. #endif
  166. #ifdef NO
  167. #undef NO
  168. #endif
  169. #ifdef HYS
  170. #undef HYS
  171. #endif
  172. #define HYS    2
  173. #define    YES    1            /* TRUE     */
  174. #define    NO    0            /* FALSE */
  175.  
  176. #define FOREVER    for (;;)
  177.  
  178. #ifndef ctUPF
  179. #define ctUPF
  180. #define USERPRF_NTKEY    0x0001        /* DO NOT PERFORM AUTO TFRMKEY    */
  181. #define USERPRF_SAVENV    0x0002        /* SAVENV MODE FOR TRANSACTIONS    */
  182. #define USERPRF_SQL    0x0004        /* ENABLE SQL SUPPORT        */
  183. #define USERPRF_SERIAL    0x0008        /* ENABLE STRICT SERIALIZATION    */
  184. #define USERPRF_MEMABS    0x0010        /* INTERNAL MEMORY MANAGEMENT    */
  185. #define USERPRF_NDATA    0x0020        /* DO NOT PERFORM AUTO DATA -    */
  186.                     /*     UNIFRMAT CONVERSION    */
  187. #define USERPRF_LOCLIB    0x0040        /* USE A LOCAL LIBRARY: not srvr*/
  188. #define USERPRF_PTHTMP    0x0080        /* add tmpname to input path    */
  189.                     /* otherwise use system tmpname */
  190. #endif /* ctUPF */
  191.  
  192. #define SYSMON_MAIN    0        /* mirror alerts & dynamic dumps*/
  193. #define SYSMON_OFF    99
  194.  
  195. #define SHADOW        0x0010        /* shadow file             */
  196. #define LOGFIL        0x0020        /* log file (=> shadow)         */
  197. #define TWOFASE        0x0040        /* two phase transaction     */
  198. #define PENDERR        0x0080        /* pending error         */
  199. #define OVRFASE        0x0001        /* tranovr processing         */
  200. #define CIPFASE        0x0002        /* promote WRL to WXL phase  */
  201. #define SAVENV        0x0100        /* save environment         */
  202.  
  203. #define SAVECTREE    1
  204. #define RESTORECTREE    2
  205.  
  206. #define RES_TYPNUM    2
  207. #define RES_TYPE    4
  208. #define RES_FIRST    8
  209. #define    RES_NAME    16
  210. #define RES_POS        32
  211. #define RES_LENGTH    64
  212. #define RES_LOCK    1
  213. #define RES_NEXT    128
  214. #define RES_UNAVL    256
  215.  
  216. #define BAT_CAN        0x0001
  217. #define BAT_NXT        0x0002
  218. #define BAT_GET        0x0003
  219. #define BAT_DEL        0x0004
  220. #define BAT_UPD        0x0005
  221. #define BAT_INS        0x0006
  222. #define BAT_OPC_RESV    0x0007
  223.  
  224. #define BAT_PKEY    0x0000
  225. #define BAT_RESV1    0x0008
  226. #define BAT_VERIFY    0x0010
  227. #define BAT_RET_REC    0x0020
  228. #define BAT_RET_POS    0x0040
  229. #define BAT_RET_KEY    0x0080
  230. #define BAT_GKEY    0x0100
  231. #define BAT_RPOS    0x0200
  232. #define BAT_KEYS    0x0400
  233. #define BAT_LOK_RED    0x0800
  234. #define BAT_LOK_WRT    0x1000
  235. #define BAT_COMPLETE    0x2000
  236. #define BAT_FLTR    0x4000
  237. #define BAT_RESV2    0x8000
  238.  
  239. #define EXCLUSIVE     0x0000        /* file in locked mode         */
  240. #define SHARED        0x0001        /* file in shared mode         */
  241. #define    VIRTUAL        0x0000        /* file is virtually opened  */
  242. #define    PERMANENT    0x0002        /* file is physically opened */
  243. #define    ctFIXED        0x0000        /* fixed length data         */
  244. #define    VLENGTH        0x0004        /* variable length data         */
  245. #define READFIL        0x0008        /* read only file lock         */
  246. #define PREIMG        SHADOW        /* transactions w/o recovery */
  247. #define TRNLOG        (LOGFIL | SHADOW) /* PREIMG + recovery         */
  248. #define WRITETHRU    0x0040        /* write thru buffering         */
  249. #define CHECKLOCK    0x0080        /* must own lock for update  */
  250. #define DUPCHANEL    0x0100        /* two i/o channels         */
  251. #define SUPERFILE    0x0200        /* superfile shell         */
  252. #define CHECKREAD    0x0400        /* must own lock on read     */
  253. #define DISABLERES    0x0800        /* disable resource on create*/
  254. #define MIRROR_SKP    0x2000        /* OK to open primary w/o mir*/
  255. #define OPENCRPT    0x4000        /* open corrupt file         */
  256.  
  257. #define OPF_NONE    0x00001L
  258. #define OPF_READ    0x00002L
  259. #define OPF_WRITE    0x00004L
  260. #define OPF_DEF        0x00008L
  261. #define OPF_DELETE    0x00010L
  262. #define OPF_ALL        (OPF_READ | OPF_WRITE | OPF_DEF | OPF_DELETE)
  263.  
  264. #define GPF_NONE    0x00020L
  265. #define GPF_READ    0x00040L
  266. #define GPF_WRITE    0x00080L
  267. #define GPF_DEF        0x00100L
  268. #define GPF_DELETE    0x00200L
  269. #define GPF_ALL        (GPF_READ | GPF_WRITE | GPF_DEF | GPF_DELETE)
  270.  
  271. #define WPF_NONE    0x00400L
  272. #define WPF_READ    0x00800L
  273. #define WPF_WRITE    0x01000L
  274. #define WPF_DEF        0x02000L
  275. #define WPF_DELETE    0x04000L
  276. #define WPF_ALL        (WPF_READ | WPF_WRITE | WPF_DEF | WPF_DELETE)
  277.  
  278. #define OPF_NOPASS    0x08000L    /* read only without password */
  279. #define GPF_NOPASS    0x10000L
  280. #define WPF_NOPASS    0x20000L
  281.  
  282. #define NONEXCLUSIVE    (READFIL | SHARED)
  283. #define COMPLETE    EXCLUSIVE
  284. #define PARTIAL        SHARED
  285. #define NOTREUSE    0x0010        /* key type modifier: !reuse nodes  */
  286.  
  287. #define REGADD       0    /* See ADDKEY: split full nodes in half     */
  288. #define INCADD       1    /* split nodes to handle increasing values  */
  289. #define DECADD       2    /* split nodes to handle decreasing values  */
  290.  
  291. #define FRSADD        0    /* See LOADKEY: first call to LOADKEY        */
  292. #define NXTADD        1    /* subsequent calls to LOADKEY            */
  293. #define BLDADD        2    /* call to signal completion of LOADKEY        */
  294.  
  295. #ifndef ctLKIMDS
  296. #define ctLKIMDS
  297. #define    FREE        0    /* free all pending data record locks        */
  298. #define RESET        1    /* same as FREE followed by ENABLE, etc.    */
  299. #define ENABLE        2    /* enable non-blocking data record locks    */
  300. #define ENABLE_BLK    3    /* enable blocking data record locks        */
  301. #define READREC        4    /* enable read only record locks        */
  302. #define SUSPEND        5    /* temporarily suspend enable mode        */
  303. #define RESTORE        6    /* restore enable mode                */
  304. #define RESTRED        7    /* restore read lock mode            */
  305. #define RESTORE_BLK    8    /* restore enable_blk mode            */
  306. #define ctKEEP        9    /* no affect: as if LKISAM not called        */
  307. #define FREE_TRAN    10    /* used by TRANEND to signal FREE from tran */
  308. #define READREC_BLK    11
  309. #define ctLK_RSV    12
  310. #define ctLK_RSV_BLK    13
  311. #define RESTRED_BLK    14
  312. #define RESTRSV        15
  313. #define RESTRSV_BLK    16
  314. #define SS_LOCK        17
  315. #define FREE_FILE    18    /* free all user locks for given data file  */
  316. #define ctLKMD_RSV    8
  317. #define LK_BLOCK    1
  318. #define TRNBEGLK    (ENABLE | READREC | ctLKMD_RSV | LK_BLOCK)
  319. #endif
  320.  
  321. #define ctNEWRECFLG    2
  322.  
  323. #define RECLEN        0
  324. #define KEYLEN        1
  325. #define FILTYP        2
  326. #define FILMOD        3
  327. #define REVMAP        4
  328. #define KEYTYP        5
  329. #define KEYDUP        6
  330. #define LOGSIZ        10
  331. #define PHYSIZ        11
  332. #define NODSIZ        12
  333. #define KEYMEM        13
  334. #define KEYPAD        14
  335. #define FLDELM        15
  336. #define RECPAD        16
  337. #define MIRRST        17
  338. #define RELKEY        18
  339.  
  340. #define FILNAM        0
  341. #define FRSFLD        1
  342. #define LSTFLD        2
  343. #define IDXNAM        3
  344. #define MIRNAM        4
  345.  
  346. #define CHKNUL        '\1'
  347.  
  348. /* Transaction Modes */
  349.  
  350. #define NONE        0
  351.  
  352. #define RCVMOD        0
  353. #define BAKMOD        1
  354. #define FWDMOD        2
  355.  
  356. #define TRNNUM        0
  357. #define TRNTIM        1
  358.  
  359. #define SAVCURI        0
  360. #define RSTCURI        1
  361. #define SWTCURI        2
  362.  
  363. /* Isam Segment Modes */
  364.  
  365. #define REGSEG        0    /* no modification        */
  366. #define INTSEG        1    /* unsigned integer        */
  367. #define UREGSEG        2    /* upper case translation    */
  368. #define SRLSEG        3    /* 4 byte auto serial number    */
  369. #define VARSEG        4    /* no mod. var length field    */
  370. #define UVARSEG        5    /* upper case. var length field    */
  371. #define YOURSEG1    6    /* reserved for your use    */
  372. #define YOURSEG2    7    /* reserved for your use    */
  373. #define SGNSEG        8    /* signed integer segment    */
  374. #define FLTSEG        9    /* floating point segment    */
  375. #define DECSEG        10    /* SQL BCD segment        */
  376. #define BCDSEG        11    /* reserved for future use    */
  377. #define SCHSEG        12    /* field number from schema    */
  378. #define USCHSEG        13    /* upper case field # from sch    */
  379. #define VSCHSEG        14    /* fixed len treated as var    */
  380. #define UVSCHSEG    15    /* VSCHSEG + upper case        */
  381. #define XTDSEG        256    /* beginning of xtd segments    */
  382. #define SEGMSK        0x010f    /* permits a seg mode range 0-15
  383.                    and 256-271 */
  384. #define DSCSEG        0x0010    /* mode + 16 for descending    */
  385. #define ALTSEG        0x0020    /* mode + 32 for alternate seq    */
  386. #define ENDSEG        0x0040    /* reverses bytes in segment to */
  387.                 /* permit end of field searches    */
  388. #define RSVSEG        0x0080  /* reserve segment modifier */
  389.  
  390.  
  391. #define OPS_ONCE_LOK    0x0004        /* 2 byte values to pass in rqst*/
  392. #define OPS_RSVD_2B1    0x0020
  393. #define OPS_RSVD_2B2    0x0040
  394. #define OPS_RSVD_2B3    0x0080
  395. #define OPS_RSVD_2B4    0x0100
  396.  
  397. #define OPS_STATE_OFF    0x00000000
  398. #define OPS_STATE_SET    0x00000001
  399. #define OPS_STATE_ON    0x00000002
  400. #define OPS_STATE_RET    0x00000003
  401. #define OPS_STATE_VRET    0x00000004
  402.  
  403. #define OPS_UNLOCK_ADD    0x00000001    /* auto unlock on add        */
  404. #define OPS_UNLOCK_RWT    0x00000002    /* auto unlock on rewrite    */
  405. #define OPS_UNLOCK_UPD    (OPS_UNLOCK_ADD | OPS_UNLOCK_RWT)
  406. #define OPS_LOCKON_GET    ((LONG) OPS_ONCE_LOK) /* lock next fetch only    */
  407. #define OPS_VARLEN_CMB    0x00000008    /* get var len on one fetch    */
  408. #define OPS_SERVER_SHT    0x00000010    /* server is shutting down    */
  409.                     /* RSVD_2B1            */
  410.                     /* RSVD_2B2            */
  411.                     /* RSVD_2B3            */
  412.                     /* RSVD_2B4            */
  413. #define OPS_ADMOPN    0x00000200    /* ADMIN forced open (OPNFIL)    */
  414. #define OPS_OMITCP    0x00000400    /* omit files from checkpoint    */
  415. #define OPS_SKPDAT    0x00000800    /* replaces SKIPDATA file mode    */
  416. #define OPS_MIRROR_NOSWITCH 0x00001000    /* don't continue operation if  */
  417.                     /* mirror or primary fails.    */
  418.  
  419. #define OPS_CLIENT_TRM    0x00002000    /* server has been terminated    */
  420. #define OPS_MIRROR_TRM    0x00004000    /* a primary or mirror has been */
  421.                     /* shutdown            */
  422. /* USE THIS VALUE NEXT    0x00008000                    */
  423.  
  424. #define OPS_internal    (OPS_SERVER_SHT    | OPS_ADMOPN | OPS_OMITCP | OPS_SKPDAT | OPS_CLIENT_TRM)
  425. #define OPS_permanent    (OPS_SERVER_SHT | OPS_CLIENT_TRM | OPS_MIRROR_TRM)
  426.             /*
  427.             ** the above are states not to be cleared by a SET zero
  428.             */
  429.  
  430.  
  431. #define DEF_IFIL    0
  432. #define DEF_MAP        1
  433. #define DEF_NAMES    2
  434. #define DEF_SQL1    3
  435. #define DEF_SQL2    4
  436. #define DEF_SQL3    5
  437. #define DEF_DTREE1    6
  438. #define DEF_DTREE2    7 
  439. #define DEF_DTREE3    8 
  440. #define DEF_NATLNG1    9
  441. #define DEF_NATLNG2    10
  442. #define DEF_NATLNG3    11
  443. #define DEF_RESRVD1    12
  444. /*
  445. ** ................    ..
  446. */
  447. #define DEF_RESRVD20    31
  448. #define DEF_NUMBER    32
  449.  
  450. #define FCRES_DATA    1
  451. #define FCRES_SCRT    2
  452. #define FCRES_IDX    3
  453. #define FCRES_SQL    4
  454. #define FCRES_CIDX    5
  455. #define FCRNAM_LEN    8
  456.  
  457. /* synonyms */
  458.  
  459. #define tfrmkey        TFRMKEY
  460. #define alcset        ALCSET
  461. #define chgset        CHGSET
  462.  
  463. #define FNSYSABS    1
  464. #define FNSRVDIR    2
  465. #define FNLOCSRV    3
  466.  
  467. typedef struct ctinit1 {
  468.     COUNT     initype;    /* MUST BE SET TO ONE (1) */
  469.     COUNT     maxuser;    /* maximum number of users */
  470.     LONG     logspac;    /* space for log files in MB */
  471.     LONG     totmem;    /* total memory (0 => no limit) */
  472.     LONG     usrmem;    /* default limit per user (0 => no limit) */
  473.     LONG     coopcmt;    /* co-operative commit factor */
  474.     LONG     idxcmem;    /* index buffer memory */
  475.     LONG     datcmem;    /* data buffer memory */
  476.     pTEXT     srvdirc;    /* server file directory */
  477.     pTEXT     evenstr;    /* even start file */
  478.     pTEXT     odd_str;    /* odd start file */
  479.     pTEXT     evenlog;    /* even log files */
  480.     pTEXT     odd_log;    /* odd log files */
  481.     pTEXT     preimgf;    /* pre-image swap file prefix */
  482.     pTEXT     srvrnam;    /* server logical name */
  483.     COUNT     maxfile;    /* maximum number of data files and indices */
  484.     COUNT     idxbufs;    /* number of index buffers */
  485.     COUNT     datbufs;    /* number of data buffers */
  486.     COUNT     bufsect;    /* 128 sectors per buffer */
  487.     COUNT     reservd;
  488.     COUNT     filname;    /* file name strategy:    0 no modification,
  489.                 ** FNSYSABS        1 change to system abs,
  490.                 ** FNSRVDIR        2 prepend srv direct,
  491.                 ** FNLOCSRV        3 same as 2, but only
  492.                 **              for mbopen\mbcrat
  493.                 */
  494.     LONG     reservl;
  495.     pTEXT     evenstrm;    /* even start file */
  496.     pTEXT     odd_strm;    /* odd start file */
  497.     pTEXT     evenlogm;    /* even log files */
  498.     pTEXT     odd_logm;    /* odd log files */
  499. } CTINIT1;
  500. typedef CTINIT1 ctMEM *    pCTINIT1;
  501.  
  502. typedef struct pkeyreq {
  503.     LONG    btotal;        /* total in set            */
  504.     LONG    bavail;        /* number available        */
  505.     LONG    breturn;    /* number returned        */
  506.     COUNT    siglen;        /* significant partial key len    */
  507.     TEXT    target[255];    /* partial key target        */
  508.     } PKEYREQ;
  509. typedef PKEYREQ ctMEM *    pPKEYREQ;
  510. #define PKEYLEN    (3 * SIZEOF(LONG) + SIZEOF(COUNT))
  511.  
  512. typedef struct usrprf {
  513.     COUNT    utaskid;    /* internal task id        */
  514.     COUNT    uactflg;    /* active request indicator    */
  515.     TEXT    uname[32];    /* user id string        */
  516.     TEXT    ucominfo[32];    /* communication info        */
  517.     TEXT    urqst[16];    /* last request function name    */
  518.     LONG    umemsum;    /* user memory            */
  519.     LONG    ulogtim;    /* logon time            */
  520.     LONG    ucurtim;    /* current time            */
  521.     LONG    urqstim;    /* time of last request        */
  522.     LONG    utrntim;    /* time of last TRANBEG        */
  523.     LONG    unbrfil;    /* number of open files        */
  524.     LONG    urqstfn;    /* last request function #    */
  525.     TEXT    unodnam[32];    /* node ID information        */
  526.     } USRPRF;
  527. typedef USRPRF ctMEM * pUSRPRF;
  528. #define USRLSTSIZ    256
  529.  
  530. #define ALTSEQSIZ    256
  531. #define ALTSEQBYT    (ALTSEQSIZ * SIZEOF(COUNT))
  532.  
  533. typedef struct {
  534.     LONG    blkoff;        /* offset from beginning of resource    */
  535.     UCOUNT    blklen;        /* total length                */
  536.     UCOUNT    blkutl;        /* utilized length             */
  537.     } DEFBLK;
  538. typedef DEFBLK ctMEM *    pDEFBLK;
  539.  
  540. typedef struct {
  541.     ULONG    restyp;
  542.     ULONG    resnum;
  543.     TEXT    resnam[FCRNAM_LEN];
  544.     LONG    reslen;
  545.     LONG    restim;
  546.     DEFBLK    resblk[DEF_NUMBER];
  547.     } RESDEF;
  548. typedef RESDEF ctMEM *    pRESDEF;
  549.  
  550. typedef struct defdef {
  551.     pVOID     ddefptr;    /* pointer to definition data    */
  552.     VRLEN     ddeflen;    /* actual length        */
  553.     VRLEN     ddeftot;    /* total length including slack */
  554.     COUNT     ddefnum;    /* DEF_xxxx or IDX kmem        */
  555.     COUNT     ddeftyp;    /* data or index definition    */
  556.     } DEFDEF;
  557. typedef DEFDEF ctMEM *    pDEFDEF;
  558.  
  559. #define ctDODA
  560. typedef struct {
  561.     pTEXT   fsymb;    /* ptr to optional symbol            */
  562.     pTEXT   fadr;    /* adr of structure member or other item    */
  563.     UCOUNT    ftype;    /* type indicator                */
  564.     UCOUNT    flen;    /* item length information            */
  565.     COUNT    fwhat;    /* structure classification            */
  566.     COUNT    flev;    /* file level reference                */
  567.     UCOUNT    fhrc;    /* file hierarchy                */
  568.     COUNT    frsv;    /* unused                    */
  569.     pVOID    fusrp;    /* user assignable information block        */
  570.     pVOID    frsrv;    /* reserved                    */
  571.     } DATOBJ;
  572. typedef DATOBJ ctMEM *    pDATOBJ;
  573.  
  574. typedef struct convmap {
  575.     UTEXT    flavor;
  576.     UTEXT    align;
  577.     UTEXT    flddelm;
  578.     UTEXT    padding;
  579.     VRLEN    maplen;
  580.     VRLEN    nbrflds;
  581.     VRLEN    nbrblks;
  582.     } ConvMap;
  583. typedef ConvMap ctMEM *    pConvMap;
  584.  
  585. typedef struct convblk {
  586.     UCOUNT    len;
  587.     UTEXT    kind;
  588.     UTEXT    repcnt;
  589.     } ConvBlk;
  590. typedef ConvBlk ctMEM *    pConvBlk;
  591.  
  592. #define SCHEMA_MAP        1
  593. #define SCHEMA_NAMES        2
  594. #define SCHEMA_MAPandNAMES    3
  595. #define SCHEMA_DODA        4
  596.  
  597. #define SegOff(struc, member)        ((NINT)&(((struc *)0)->member))
  598. #define ArraySegOff(struc, member)    ((NINT) (((struc *)0)->member))
  599.  
  600. #ifndef ctDTPYES
  601. #define ctDTYPES
  602. #define CT_BOOL        (1 << 3)
  603. #define CT_CHAR        (2 << 3)
  604. #define CT_CHARU    (3 << 3)
  605. #define CT_INT2        ((4 << 3) + 1)
  606. #define CT_INT2U    ((5 << 3) + 1)
  607. #define CT_INT4        ((6 << 3) + 3)
  608. #define CT_INT4U    ((7 << 3) + 3)
  609. #define CT_MONEY    ((8 << 3) + 3)
  610. #define CT_DATE        ((9 << 3) + 3)
  611. #define CT_TIME        ((10 << 3) + 3)
  612. #define CT_SFLOAT    ((11 << 3) + 3)
  613. #define CT_DFLOAT    ((12 << 3) + 7)
  614. #define CT_SQLBCDold    ((13 << 3) + 3)
  615. #define CT_SQLBCD    ((13 << 3) + 4)
  616. #define CT_EFLOAT    ((14 << 3) + 7)
  617. #define CT_TIMESold    ((15 << 3) + 3)
  618. #define CT_TIMES    ((15 << 3) + 4)
  619. #define CT_ARRAY    (16 << 3)
  620. #define CT_RESRVD    (17 << 3)
  621.  
  622. #define CT_FSTRING    (18 << 3)
  623. #define CT_FPSTRING    (19 << 3)
  624. #define CT_F2STRING    (20 << 3)
  625. #define CT_F4STRING    (21 << 3)
  626. #define CT_STRING    (CT_FSTRING + 2)
  627. #define CT_PSTRING    (CT_FPSTRING + 2)
  628. #define CT_2STRING    (CT_F2STRING + 2)
  629. #define CT_4STRING    (CT_F4STRING + 2)
  630. #define CT_LAST        CT_4STRING
  631. #endif
  632.  
  633. #define CT_STRFLT    (CT_LAST + 1)
  634. #define CT_STRLNG    (CT_LAST + 2)
  635. #define CT_NUMSTR    (CT_LAST + 3)
  636. #define CT_DBLSTR    (CT_LAST + 4)
  637. #define CT_SUBSTR    (CT_LAST + 5)
  638. #define CT_WLDCRD    (CT_LAST + 6)
  639.  
  640. #define SEC_FILEWORD    1
  641. #define SEC_FILEGRUP    2
  642. #define SEC_FILEMASK    3
  643. #define SEC_FILEOWNR    4
  644.  
  645. #define ctSEGLEN    1
  646. #define ctSEGMOD    2
  647. #define ctSEGPOS    3
  648.  
  649. /*
  650.  * I/O Performance Monitoring
  651.  */
  652.  
  653. #define    DataBufferRequests    0
  654. #define DataBufferHits        1
  655. #define    IndexBufferRequests    2
  656. #define IndexBufferHits        3
  657. #define NbrReadOperations    4
  658. #define NbrBytesRead        5
  659. #define NbrWriteOperations    6
  660. #define NbrBytesWritten        7
  661.  
  662. #define updateIFIL        -99
  663.  
  664. /*
  665.  * YOU MAY ADD ONE OR MORE OF THE FOLLOWING DEFINES TO MAINTAIN 
  666.  * COMPATIBILITY WITH c-tree PLUS RELEASES PRIOR TO RELEASE C.
  667.  *
  668. #define FIXED        ctFIXED
  669. #define KEEP        ctKEEP
  670.  *
  671.  */
  672.  
  673.  
  674. #endif /* ctPORTH */
  675.  
  676. /* end of ctport.h */
  677.